home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 1
/
Cream of the Crop 1.iso
/
PROGRAM
/
CUJ9104.ARJ
/
9N04091A
< prev
next >
Wrap
Text File
|
1991-02-15
|
461b
|
24 lines
/* from cuj */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int comp(const void *, const void *);
unsigned char *list[] = {"cat", "car", "cab", "cap", "can"};
main()
{
int x;
qsort(list, 5, sizeof(unsigned char *), comp);
for (x = 0; x < 5; x++)
printf("%s\n", list[x]);
return 0;
}
int comp(const void *a, const void *b)
{
return strcmp( *(char **)a, *(char **)b);
}